package com.xiguaji.tiktok.v1.tiktok.blogger.repository;

import com.xiguaji.tiktok.v1.tiktok.blogger.model.BloggerFansPortrait;
import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * BloggerFansPortrait Dao
 */
@Repository
public interface BloggerFansPortraitRepository extends CrudRepository<BloggerFansPortrait,Long> {

    /**
     * 根据 uid及限制时间 查询粉丝画像数据
     * @param uid 博主id
     * @return
     */
    @Query("SELECT t.* FROM blogger_fans_portrait t WHERE t.uid = :uid  AND t.aweme_create_time >= :limitTime ")
    List<BloggerFansPortrait> findByUid(long uid,int limitTime);
}
